<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui" template="./template.xhtml">

    <ui:define name="screen">
        <h:form prependId="false">
            <h:panelGrid columns="3">
                <h:outputLabel for="nome" value="Nome" />
                <h:inputText id="nome" value="#{cadastroUsuarioController.vo.nome}" />
                <h:message for="nome" />

                <h:outputLabel for="email" value="E-mail" />
                <h:inputText id="email" value="#{cadastroUsuarioController.vo.email}" required="true" />
                <h:message for="email" />

                <h:outputLabel for="confirmacaoEmail" value="Confirmação do e-mail" />
                <h:inputText id="confirmacaoEmail" value="#{cadastroUsuarioController.vo.confirmacaoEmail}" />
                <h:message for="confirmacaoEmail" />

                <h:outputLabel for="senha" value="Senha" />
                <h:inputText id="senha" value="#{cadastroUsuarioController.vo.senha}" />
                <h:message for="senha" />

                <h:outputLabel for="confirmacaoSenha" value="Confirmação da senha" />
                <h:inputText id="confirmacaoSenha" value="#{cadastroUsuarioController.vo.confirmacaoSenha}" />
                <h:message for="confirmacaoSenha" />
            </h:panelGrid>
            <h:commandButton actionListener="#{cadastroUsuarioController.salvar}" value="Salvar" />
            <h:commandLink actionListener="#{cadastroUsuarioController.limpar}" value="Limpar" />
        </h:form>

        <h:form prependId="false">
            <h:outputLabel for="filtro" value="Nome" />
            <h:inputText id="filtro" value="#{cadastroUsuarioController.filtro}" required="true" />
            <h:commandButton actionListener="#{cadastroUsuarioController.filtrar}" value="Salvar" />
            <h:message for="filtro" />
                
            <p:dataTable var="u" value="#{cadastroUsuarioController.usuarioList}">  
                <p:column>  
                    <f:facet name="header">Nome</f:facet>  
                    <h:outputText value="#{u.nome}" />  
                </p:column>
                <p:column>  
                    <f:facet name="header">E-mail</f:facet>  
                    <h:outputText value="#{u.email}" />  
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>

</ui:composition>